package org.nulldevice.tankshot;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class GameMouseListener extends MouseAdapter {

	Game game;

	public GameMouseListener(Game game) {
		this.game = game;
	}

	public void mouseMoved(MouseEvent e) {
		game.setMousePosition(e.getX(), e.getY());
	}

	public void mouseReleased(MouseEvent e) {
		if (e.getButton() == MouseEvent.BUTTON3) {
			// place mine
			game.playerPlacesMine();
		} else {
			// Every other mouse-button will fire
			game.playerShoots();
		}
	}
}
